class MyPoint(object):
    def __init__(self, a=0, b=0):
        self.x = a
        self.y = b

    def __eq__(self, f):
        return self.x==f.x and self.y==f.y
    
    def __ne__(self, f):
        return not self==f

    def __hash__(self):
        return (self.x+self.y)*(self.x+self.y+1)//2 + self.y
    
    def __repr__(self):
        return "[{},{}]".format(self.x, self.y)
        
class Line:
    def __init__(self, p0, p1):
        if p0==p1:
            print("invalid line")
            return
        self.a = p0.y - p1.y
        self.b = p1.x - p0.x
        self.c = p0.x*p1.y - p1.x*p0.y
        if self.c<0:
            self.a, self.b, self.c = -self.a, -self.b, -self.c
        elif self.c==0 and self.b<0:
            self.a, self.b = -self.a, -self.b
        sa = -1 if self.a<0 else 1
        sb = -1 if self.b<0 else 1
        sc = -1 if self.c<0 else 1
        self.a = abs(self.a)
        self.b = abs(self.b)
        self.c = abs(self.c)
        def gcd(a, b):
            if a<b: a,b = b, a
            while b!=0:
                temp = a%b
                a=b
                b=temp
            return a
        ab = gcd(self.a, self.b)
        bc = gcd(self.b, self.c)
        abc = gcd(ab, bc)
        self.a //= abc
        self.b //= abc
        self.c //= abc
        self.a *= sa
        self.b *= sb
        self.c *= sc

    def __eq__(self, l):
        return self.a==l.a and self.b==l.b and self.c==l.c

    def __ne__(self, l):
        return not self==l

    def __hash__(self):
        return self.a + self.b + self.c

class Solution(object):
    def maxPoints(self, points):
        """
        :type points: List[Point]
        :rtype: int
        """
        points = [MyPoint(point.x, point.y) for point in points]
        if len(points)==0:return 0
        pointDict = {}
        for point in points:
            if point not in pointDict:
                pointDict.update({point:0})
            pointDict[point]+=1
        if len(pointDict)==1: return pointDict[points[0]]
        points = list(pointDict.keys())
        lines = {}
        for i in range(len(points)):
            for j in range(i+1, len(points)):
                line = Line(points[i], points[j])
                if line not in lines:
                    lines.update({line:set([points[i], points[j]])})
                else:
                    lines[line].add(points[i])
                    lines[line].add(points[j])
        
        if len(lines.values())==0:return 0
        else: return max(map(lambda points:sum(map(lambda point:pointDict[point], points)), lines.values()))

points = [MyPoint(0, 0), MyPoint(1,1), MyPoint(1, -1)]
print(Solution().maxPoints(points))